<?php

    error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING);
    header("Content-type: text/html; charset=utf-8");	 

	$channel = $_GET['channel'];	
	$plat = $_GET['plat'];
	$version = $_GET['version'];

    $name_port = $_SERVER['SERVER_NAME'].':'.$_SERVER["SERVER_PORT"];
	$url = $name_port.'/api/?r=server/download&plat='.$plat.'&channel='.$channel.'&version='.$version;
	echo curl_get_https($url);
	exit;




function curl_get_https($url){
    $curl = curl_init(); // 启动一个CURL会话
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_HEADER, 0);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); // 跳过证书检查
    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, true);  // 从证书中检查SSL加密算法是否存在
    $tmpInfo = curl_exec($curl);     //返回api的json对象
    //关闭URL请求
    curl_close($curl);
    return $tmpInfo;    //返回json对象
}
